package com.wyh.user.covert;

import com.bite.common.utils.SecurityUtil;
import com.bite.user.api.pojo.UserInfoRegisterRequest;
import com.wyh.user.dataobject.UserInfo;

public class BeanCovert {
    public static UserInfo covertToUserInfo(UserInfoRegisterRequest request){
        if (request == null){
            return null;
        }
        UserInfo userInfo = new UserInfo();
        userInfo.setUserName(request.getUserName());
        userInfo.setEmail(request.getEmail());
        userInfo.setPassword(SecurityUtil.encrypt(request.getPassword()));
        userInfo.setGithubUrl(request.getGithubUrl());
        return userInfo;
    }
}
